korr = zeros(480,640);
bdsmodel = model/max(max(model));
bdsmodel = [sum(bdsmodel,1), sum(bdsmodel,2)'] ;
bdsmodel = bdsmodel/sum(sum(bdsmodel));
for i=1:10:380
    for j=1:20:540
        w=img(i:i+99, j:j+99);
        bdsw = w/max(max(w));
        bdsw = [sum(bdsw,1), sum(bdsw,2)'] ;
        bdsw = bdsw/sum(sum(bdsw));
        korr(i,j)=sum(sqrt(bdsmodel .* bdsw));
    end
    i
end
